use serde::Deserialize;

#[derive(Debug, Deserialize, Clone)]
pub struct AuthConfig {
    pub issuer_uri: Option<String>,
    #[serde(default)]
    pub audience: Option<String>,
}

impl AuthConfig {
    pub fn issuer_uri(&self) -> &str {
        self.issuer_uri.as_deref().unwrap_or("http://localhost:8080/realms/master/")
    }
    pub fn audience(&self) -> &str {
        self.audience.as_deref().unwrap_or("rid-client")
    }
}